//
//  BSHotCommentView.m
//  BaiSi
//
//  Created by Sycamore on 16/5/4.
//  Copyright © 2016年 Sycamore. All rights reserved.
//

#import "BSHotCommentView.h"
#import "BSThemeItem.h"
#import "BSCommentItem.h"
#import "BSUserItem.h"

@interface BSHotCommentView ()
@property (weak, nonatomic) IBOutlet UIView *contentView;

@property (weak, nonatomic) IBOutlet UILabel *userName;

@property (weak, nonatomic) IBOutlet UIButton *playButton;
@property (weak, nonatomic) IBOutlet UILabel *commentLabel;

@end

@implementation BSHotCommentView

- (void)setItem:(BSThemeItem *)item
{
    [super setItem:item];
    
    //显示文字评论
    if (item.commentItem.content.length > 0) {
        _contentView.hidden = YES;
        _commentLabel.hidden = NO;
        
        _commentLabel.text = item.commentItem.totleComment;
    }
    else{
        //显示语音评论
        _commentLabel.hidden = YES;
        _contentView.hidden = NO;
        
        _userName.text = [NSString stringWithFormat:@"%@:",item.commentItem.userItem.username];
        [_playButton setTitle:item.commentItem.voicetime forState:UIControlStateNormal];
    }
}


@end
